home *** CD-ROM | disk | FTP | other *** search
- /*
- ADPRO IFF FRAMES TO ANIM
- By J.L. White
- ©1994 Merlin's Software
-
- Convert IFF Frames To Anim5
- Art Department Pro Script
-
- Batch Factory Batch Conversion Scripts are basically Arexx scripts that
- allow you to pass certain parameters to the external program you wish
- to use to convert the images from one format to another. You can pass
- five different strings from Batch Factory to the script by using the
- following commands:
-
- $N = This will pass the current selected filename.
- $P = This will tell Batch Factory to ask for a path to save new frames to.
- $# = This will pass the current frame number in the script.
- $T = This will pass the total number of frames in the script.
- $A = This will pass an offset number to be used to save frames with.
-
- NOTE: The following line is required to work as a Batch Factory Script:
-
- PARSE=$N $# $T
-
- */
-
- options results
- call Locate_ADPro
-
- address "ADPro"
- arg TheFile FrameNum TotalFiles
-
- PAR = '22'X
-
- if FrameNum = 1 then do
- adpro_to_front
- Getfile '"Enter Name For Animation!"'
- if RC ~= 0 then do
- adpro_to_front
- okay1 "I Need a Name To Work Correctly!"
- adpro_to_back
- pause 100
- exit
- end
- NAME = ADPRO_RESULT
- Path = GetPathName(NAME)
- Pic = GetFileName(NAME)
- if Path = "RAM DISK:" then do
- NAME = "RAM:"Pic
- end
- pstatus Unlocked
- RList = '"0" "2" "4" "8" "16" "32" "64" "128" "256" "EHB" "HAM" "HAM8 "'
- Listview '"Choose Render Mode"' 8 '"Load"' ITEMS RList
- parse var adpro_result Colors Blah
- Colors = strip(Colors,'B',PAR)
-
- RList = '" " "0 - Off" "1 - Floyd" "2 - Burkes" "3 - Sierra" "4 - Jarvis" "5 - Stucki" "6 - Random" "7 - Large Order" "8 - Small Order " '
- Listview '"Choose Dither Mode"' 9 '"Load"' ITEMS RList
- parse var adpro_result MyDither"-"Blah
- MyDither = strip(MyDither,'B',PAR)
-
- call open TempFile,"Ram:AIFTA",W
- call writeln TempFile,NAME
- call writeln TempFile,Colors
- call writeln TempFile,MyDither
- call close TempFile
- end
- else do
- call open TempFile,"Ram:AIFTA",R
- line = readln(TempFile)
- parse var line NAME
- line = readln(TempFile)
- parse var line Colors
- line = readln(TempFile)
- parse var line MyDither
- call close TempFile
- end
- if FrameNum = TotalFiles then
- address command "delete >NIL: Ram:AIFTA"
- lformat "UNIVERSAL"
- load TheFile
- if RC ~= 0 then do
- adpro_to_front
- okay1 "Error Loading" TheFile
- adpro_to_back
- pause 100
- exit
- end
- if FrameNum =1 then pstatus Locked
- call Set_Screen
-
- execute
- sformat "ANIM"
- if FrameNum = TotalFiles then
- save NAME "SCREEN" WRAPUP
- else
- save NAME "SCREEN" APPEND
- if RC ~= 0 then do
- adpro_to_front
- okay1 "Error Saving" NAME
- adpro_to_back
- pause 100
- exit
- end
- exit
-
- Locate_ADPro:
- if (POS('ADPro',SHOW('Ports')) = 0)
- then do
- address command 'run < nil: > nil: adpro:adpro MAXMEM=5000000'
- address command 'wait 4'
- end
- return
-
-
- Set_Screen:
- Render_Type Colors
- Dither MyDither
- XSIZE
- X = adpro_result
- YSIZE
- Y = adpro_result
- SType = 0
- if X > 376 then SType = SType + 1
- if X > 350 & X < 640 then SType = SType + 8
- if X > 640 then SType = SType + 8
- if Y > 256 then SType = SType + 2
- if Y = 256 | Y = 512 then SType = SType + 4
- if Y > 200 & Y < 400 & Y ~= 256 then SType = SType + 16
- if Y > 400 & Y < 512 then SType = SType + 16
- if Y > 512 then SType = SType + 16
- Screen_Type SType
- return
-
-
- GetFileName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return substr(CompleteName, c + 1)
-
- GetPathName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return left(CompleteName,c)
-